<template>
  <div>
     <!-- 九宫格样式 -->
    <div class="style2-actions clearfix mgt10">
      <div class="style2-actions-title">我的服务</div>
      <div @click="Jump('myStore')"
           class="action"
           v-if="dhsInfo.show_dh_inventory">
        <span class="icon-action icon3_6"></span>
        <span class="title">{{dhsInfo.ftitle_dhs_stock}}</span>
      </div>
      <div @click="Jump('dhsCard')"
           class="action"
           v-if="dhsInfo.show_dhs_share_card">
        <span class="icon-action icon2_16"></span>
        <span class="title">我的名片</span>
      </div>
      <div @click="Jump('dhsGoods')"
           class="action"
           v-if="dhsInfo.show_dh_item">
        <span class="icon-action icon3_15"></span>
        <span class="title">{{dhsInfo.ftitle_dhs_item}}</span>
      </div>
      <div @click="Jump('item-list')"
           class="action"
           v-if="dhsInfo.show_dh_purchase">
        <span class="icon-action icon3_5"></span>
        <span class="title">{{dhsInfo.ftitle_dhs_purchase}}</span>
      </div>

      <!-- <div @click="Jump('/order-lists',{dhs_type:'1'})" -->
      <div @click="handleLinkTo('order-lists',{dhs_type:'1'})"
           class="action"
           v-if="dhsInfo.show_dh_purchase_order">
        <span class="icon-action icon3_7"></span>
        <span class="title">{{dhsInfo.ftitle_dhs_list}}</span>
      </div>

      <div @click="Jump('nextLevelVender')"
           class="action"
           v-if="dhsInfo.show_dh_subcontractor">
        <span class="icon-action icon3_8"></span>
        <span class="title">{{dhsInfo.ftitle_dhs_user}}</span>
      </div>

      <div @click="Jump('nextLevelVenderUser')"
           class="action"
           v-if="dhsInfo.show_dh_subMembers">
        <span class="icon-action icon3_2"></span>
        <span class="title">{{dhsInfo.ftitle_dhs_member}}</span>
      </div>

      <div @click="Jump('venderOrder')"
           class="action"
           v-if="dhsInfo.show_dhs_teamOrder">
        <span class="icon-action icon2_4"></span>
        <span class="title">{{dhsInfo.ftitle_dhs_order}}</span>
      </div>

      <div @click="Jump('virtualVenderOrder')"
           class="action"
           v-if="dhsInfo.show_dh_virtualorder">
        <span class="icon-action icon3_9"></span>
        <span class="title">{{dhsInfo.ftitle_dhs_virtual_order}}</span>
      </div>

      <!-- 七木:下级进货单、下级发货单 -->
      <div @click="Jump('virtualVenderOrder',{'order_type':1})"
           class="action"
           v-if="dhsInfo.is_virtual_order_separate">
        <span class="icon-action icon3_16"></span>
        <span class="title">下级进货单</span>
      </div>

      <div @click="Jump('virtualVenderOrder',{'order_type':2})"
           class="action"
           v-if="dhsInfo.is_virtual_order_separate">
        <span class="icon-action icon3_17"></span>
        <span class="title">下级发货单</span>
      </div>

      <div @click="handleLinkTo('order-lists', {'is_dhs_delivery': 1})"
           class="action"
           v-if="dhsInfo.show_my_delivery_order">
        <span class="icon-action icon3_18"></span>
        <span class="title">我的出货单</span>
      </div>

      <div @click="Jump('dhsRecommend')"
           class="action"
           v-if="dhsInfo.show_dh_levelSubcontractor">
        <span class="icon-action icon2_17"></span>
        <span class="title">推荐列表</span>
      </div>

      <div @click="Jump('dhsYeJi', {dhsYjGoodsType: dhsInfo.dhs_yj_goods_type})"
           class="action"
           v-if="dhsInfo.show_dh_teamPerformance">
        <span class="icon-action icon2_22"></span>
        <span class="title">团队业绩</span>
      </div>

      <div @click="Jump('director')"
           class="action"
           v-if="dhsInfo.show_dh_superior &&dhsInfo.superior_user">
        <span class="icon-action icon2_13"></span>
        <span class="title">{{dhsInfo.ftitle_superior}}</span>
        <span class="subtitle">{{dhsInfo.superior_user}}</span>
      </div>

      <!--我的上级订货商-->
      <div @click="handleLinkTo('parentInfo',{id:dhsInfo.dhs_parent_id,name:dhsInfo.user_dhs_info,type:'dhs',grade:dhsInfo.dhs_grade})"
           class="action"
           v-if="dhsInfo.show_dh_superior_orderer&&dhsInfo.dhs_is_display">
        <span class="icon-action icon2_24"></span>
        <span class="title">{{dhsInfo.ftitle_dhs_superior}}</span>
        <span class="subtitle">{{dhsInfo.user_dhs_info}}</span>
      </div>

      <div @click="Jump('dhsGlj')"
           class="action"
           v-if="dhsInfo.is_dhs_team_bonus">
        <span class="icon-action icon2_23"></span>
        <span class="title">团队管理业绩</span>
      </div>

      <div @click="Jump('dhsDeposit')"
           class="action"
           v-if="dhsInfo.is_dhs_allow_deposit">
        <span class="icon-action icon3_10"></span>
        <span class="title">我的预存款</span>
      </div>

      <div @click="Jump('DhsSalesSort')"
           class="action"
           v-if="dhsInfo.show_dhs_orderRanking">
        <span class="icon-action icon2_25"></span>
        <span class="title">出单量排行</span>
      </div>

      <div @click="Jump('store')"
           class="action"
           v-if="!dhsInfo.is_app_open && dhsInfo.is_store_log &&dhsInfo.show_dhs_myStore">
        <span class="icon-action icon2_11"></span>
        <span class="title">{{dhsInfo.ftitle_store}}</span>
      </div>

      <div @click="Jump('dhsOrderRank')"
           class="action"
           v-if="dhsInfo.dhs_team_order_sort">
        <span class="icon-action icon2_25"></span>
        <span class="title">团队订单排行</span>
      </div>
      <div v-if="dhsInfo.show_dhs_entity_order"
        @click="handleLinkTo('dhsEntityOrder')"
        class="action"
        >
          <span class="icon-action icon_stkc"></span>
          <span class="title">实体库存订单</span>
      </div>
      <!-- 定制 福萝拉 start -->
      <div @click="handleLinkTo('logsList')"
           class="action"
           v-if="dhsInfo.is_fll_dz == 1">
        <span class="icon-action icon2_28"></span>
        <span class="title">会员访问</span>
      </div>
      <!-- 定制 福萝拉 end -->
      <!-- 定制 start -->
      <div
        v-if="dzData.is_yj"
        @click="handleLinkTo('virCommission')"
           class="action">
        <span class="icon-action icon2_17"></span>
        <span class="title">虚拟佣金</span>
      </div>
      <div
        v-if="dzData.is_yj || dzData.is_ltsn || isShowHangPlug"
        @click="handleLinkTo('holdOrder')"
           class="action">
        <span class="icon-action icon2_17"></span>
        <span class="title">挂起订单</span>
      </div>
      <div
        v-if="dzData.is_yj"
        @click="handleLinkTo('virtualInventory')"
           class="action">
        <span class="icon-action icon2_17"></span>
        <span class="title">仓储明细</span>
      </div>
      <!-- 定制 end -->
      <!-- 定制 哈多多  start -->
      <div @click="JumpUrl('/User/dls_apply')"
           class="action"
           v-if="dhsInfo.dhs_can_apply_upper_levels == 1">
        <span class="icon-action icon1_10"></span>
        <span class="title">升级申请</span>
      </div>
      <!-- 定制 哈多多  end -->
      <!-- 定制 深圳市莱精选 start -->
      <!-- 莱特妮丝定制销售奖 -->
      <div @click="handleLinkTo('dzDhsSaleReward')"
        class="action"
        v-if="dhsInfo.is_offline_sale_reward == 1">
        <span class="icon-action icon3_11"></span>
        <span class="title">销售奖</span>
      </div>
       <!-- 定制 莱特妮思订货商地址start -->
      <div @click="Jump('ltnsDhsAddress')"
        class="action"
        v-if="dzData.is_ltsn">
        <span class="icon-action icon1_11"></span>
        <span class="title">地址</span>
      </div>
      <!-- 定制 莱特妮思订货商地址end -->
      <!-- 定制 莱特妮思下级协议查询start -->
      <div @click="Jump('ltnsDhsxjSelect')"
        class="action"
        v-if="dzData.is_ltsn">
        <span class="icon-action icon2_17"></span>
        <span class="title">下级协议查询</span>
      </div>
      <!-- 定制 莱特妮思下级协议查询end -->
      <!-- 定制 莱特妮思退换货审核start -->
      <div @click="Jump('ltnsDhsthSh')"
        class="action"
        v-if="dzData.is_ltsn">
        <span class="icon-action icon2_17"></span>
        <span class="title">退换货审核</span>
      </div>
      <!-- 定制 莱特妮思退换货审核end -->
      <!-- 定制 深圳市莱精选 end -->
      <!-- 定制 云集  start -->
      <div @click="JumpUrl('https://cschat-ccs.aliyun.com/index.htm?tntInstId=_1vFJMIa&scene=SCE00007501')"
           class="action"
           v-if="dhsInfo.yun_ji_top_dhs_dz == 1">
        <span class="icon-action icon3_12"></span>
        <span class="title">客服</span>
      </div>
      <!-- 定制 云集  end -->
      <!-- 定制 云集  start -->
      <div @click="handleLinkTo('GrowUp')"
           class="action"
           v-if="dhsInfo.is_yun_ji_dz == 1">
        <span class="icon-action icon2_13"></span>
        <span class="title">育成人</span>
      </div>
      <!-- 定制 云集  end -->

      <!-- 十二季 秒杀佣金 start -->
      <div v-if="dzData.is_sej_dz"  @click="handleLinkTo('twelveSeckillList')" class="action">
        <span class="icon-action icon2_34"></span>
        <span class="title">秒杀佣金</span>
      </div>
      <!-- 十二季 秒杀佣金 end -->
      <!-- 定制 王学军 平级业绩统计 start -->
      <div v-if="dzData.is_jzx_multi_dhs_dz" @click="handleLinkTo('wxjPeerStatistics')" class="action">
        <span class="icon-action icon2_23"></span>
        <span class="title">平级业绩统计</span>
      </div>
      <!-- 定制 王学军 平级业绩统计 end -->
      <!-- 定制 苏州银丰 团队业绩 start -->
      <div v-if="dzData.is_szyf_dz" @click="handleLinkTo('dhsGljDZ')" class="action">
        <span class="icon-action icon17_1_szyf"></span>
        <span class="title">平级业绩</span>
      </div>
      <!-- 定制 苏州银丰 团队业绩 end -->
      <!-- 层层报单 start -->
      <template>
        <div @click="handleLinkTo('purchaseOrder',{type:0})" v-if="dzData.dz_is_show_purchase"
             class="action">
          <span class="icon-action icon11_1_qmsc"></span>
          <span class="title">进货单</span>
        </div>
        <div @click="handleLinkTo('myPurchaseOrder',{type:1})" v-if="dzData.dz_is_show_my_purchase"
             class="action">
          <span class="icon-action icon11_2_qmsc"></span>
          <span class="title">我的进货单</span>
        </div>
        <div @click="handleLinkTo('myPurchaseOrder',{type:2})" v-if="dzData.dz_is_show_lower_purchase"
             class="action">
          <span class="icon-action icon11_3_qmsc"></span>
          <span class="title">下级进货单</span>
        </div>
      </template>
      <!-- 层层报单 ent -->
      <div @click="handleLinkTo('shareSelect')" v-if="dhsInfo.common_center_renovation_parameter.showShareLinkDhs"
            class="action">
        <span class="icon-action icon20_1_fx"></span>
        <span class="title">万能链接</span>
      </div>
      <!-- 视频号数据 -->
      <div @click="Jump('venderOrder', {type: 'live'})" class="action" v-if="dhsInfo.show_video_num_data_dhs">
        <span class="icon-action icon_sphsj"></span>
        <span class="title">视频号数据</span>
      </div>
      <!-- 自定义项 -->
      <template v-if="dhsInfo.dataset_dhs && dhsInfo.dataset_dhs.length>0">
        <div v-for="(item,index) in dhsInfo.dataset_dhs" :key="index" class="action">
          <a @click="openLink(item.link)">
            <span class="icon-action" :style="{backgroundImage: 'url('+item.pic+')',backgroundSize:'cover'}"></span>
            <span class="title">{{item.showtitle}}</span>
          </a>
        </div>
      </template>
    </div>
  </div>
</template>

<script>
import Vue from 'vue'
import { openPage } from '@/utils/utils.js'
import { getHangPlug } from '@/api/user/dhs/dhsApi'

export default Vue.extend({
  props: {
    dhsInfo: {
      type: Object
    },
    dzData: {
      type: Object
    }
  },
  data() {
    return {
      isShowHangPlug: false,
    }
  },
  created() {
    getHangPlug().then((res) => {
      if (res.status) {
        this.isShowHangPlug = res.data.is_show_hang_plun
      }
    })
  },
  methods: {
    // TODO 小程序跳转
    openLink(link) {
      openPage(link)
    },
    Jump(url, data) {
      // const data = { type }
      this.$JumpPath(this, url, data)
    },
    handleLinkTo(url, data) {
      this.$JumpName(this, url, data)
    },
    JumpUrl(url, data) {
      window.location.href = url
    },
    _show_qrcode() {
      this.$emit('showQrcode')
    }
  }
})
</script>

<style lang="scss">
@import 'src/styles/user/index.scss';
</style>
